<?php
/**
 * Purpose: 集合点模型
 * User: peter
 * Date: 2018/9/14
 * Time: 下午5:20
 */

namespace app\model;

use think\model\concern\SoftDelete;

class CollectionPoint extends Base
{
    use SoftDelete;
    protected $pk = 'id';
    // 此处表名请务必设置为public
    public $table = 'collection_point';
    //软删除
    protected $deleteTime = 'delete_time';
    protected $defaultSoftDelete = 0;
    /**
     * @purpose 根据条件获取数据条数
     * @param array $where
     * @return int
     */
    public function total(array $where = []): int
    {
        return (int)$this
            ->where($where)
            ->count();
    }
}